from django.shortcuts import render
from django.views import generic
from django.contrib.auth import authenticate, login
from django.contrib.auth.views import LoginView
from django.contrib.auth.views import LogoutView
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required

from . import forms


class AuthorizationPage(LoginView):

    form_class = forms.AuthorizationPageForm
    template_name = 'account/login.html'


class LogoutPage(LogoutView):

    template_name = 'account/logged_out.html'


@login_required
def show_dashboard(request):

    context = {'section': 'dashboard'}
    return render(request, 'account/dashboard.html', context)
